// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the ADOADAPTER_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// ADOADAPTER_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef ADOADAPTER_EXPORTS
#define ADOADAPTER_API __declspec(dllexport)
#else
#define ADOADAPTER_API __declspec(dllimport)
#endif

#pragma warning(disable:4251)

#import "msado15.dll" rename_namespace("") rename("EOF", "ADO_EOF") rename("BOF", "ADO_BOF")

#include "Database.h"
#include <list> 

class ADOADAPTER_API CADOConnection : public CResource
{
public:
  CADOConnection(const char * pszConnStr);
  ~CADOConnection();
	_variant_t getConnectionVariant(_ConnectionPtr con);

  virtual void CADOConnection::setInUse(bool bInUse);
	virtual _variant_t getConnectionVariant();
  virtual void * getConnection();
private:
  _ConnectionPtr m_connection;
};

class ADOADAPTER_API CADOPool : public CPool
{
public:
  CADOPool();
  ~CADOPool();
  virtual CResource* aquire();
  virtual void release(CResource* res);
protected:
  CResource * findNewConnection();
private:
  std::list<CResource*> m_pool;
  HANDLE m_hMutex;
};

class ADOADAPTER_API CADOPoolFactory : public CPoolFactory
{
public:
  CPool* getPool();
};